package com.collect.tanzania.zhiScene.zhiOrderReview.zhiFollow.bean;

import android.text.TextUtils;

import com.collect.tanzania.zhiUtils.StringUtil;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class ZHIROrderReviewDetailUserEntity implements Serializable {

    private String applyTime;

    private String mobile;
    private String bvnNumber;
    private String fullName;
    private String birthDate;
    private String gender;
    private String maritalStatus;
    private String highestEducation;

    private String language;
    private String religion;
    private String email;
    private String faceImg;
    private String fatherName;
    private String proofFrontImg;
    private String proofBackImg;
    private String addressProofType;
    private String employmentType;
    private String monthlyIncome;
    private String workInfoTime;

    public String getBvnNumber() {
        return bvnNumber;
    }

    public void setBvnNumber(String bvnNumber) {
        this.bvnNumber = bvnNumber;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(String birthDate) {
        this.birthDate = birthDate;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getMaritalStatus() {
        return maritalStatus;
    }

    public void setMaritalStatus(String maritalStatus) {
        this.maritalStatus = maritalStatus;
    }

    public String getReligion() {
        return religion;
    }

    public void setReligion(String religion) {
        this.religion = religion;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFaceImg() {
        return StringUtil.safeString(faceImg);
    }

    public void setFaceImg(String faceImg) {
        this.faceImg = faceImg;
    }

    public String getFatherName() {
        return fatherName;
    }

    public void setFatherName(String fatherName) {
        this.fatherName = fatherName;
    }

    public String getProofFrontImg() {
        return StringUtil.safeString(proofFrontImg);

    }

    public void setProofFrontImg(String proofFrontImg) {
        this.proofFrontImg = proofFrontImg;
    }

    public String getProofBackImg() {
        return StringUtil.safeString(proofBackImg);

    }

    public void setProofBackImg(String proofBackImg) {
        this.proofBackImg = proofBackImg;
    }

    public String getAddressProofType() {
        return addressProofType;
    }

    public void setAddressProofType(String addressProofType) {
        this.addressProofType = addressProofType;
    }

    public String getEmploymentType() {
        return employmentType;
    }

    public void setEmploymentType(String employmentType) {
        this.employmentType = employmentType;
    }

    public String getMonthlyIncome() {
        return monthlyIncome;
    }

    public void setMonthlyIncome(String monthlyIncome) {
        this.monthlyIncome = monthlyIncome;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getHighestEducation() {
        return highestEducation;
    }

    public void setHighestEducation(String highestEducation) {
        this.highestEducation = highestEducation;
    }

    public String getWorkInfoTime() {
        if(TextUtils.isEmpty(workInfoTime)) return null;
        workInfoTime = formatDate(workInfoTime);

        return workInfoTime;
    }

    public void setWorkInfoTime(String workInfoTime) {
        this.workInfoTime = workInfoTime;
    }

    public static String formatDate(String inputDateStr) {
        // 原始日期格式
        SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());

        // 输出日期格式
        SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());

        try {
            // 解析输入的日期字符串
            Date date = inputFormat.parse(inputDateStr);

            // 将日期格式化为所需的输出格式
            if (date != null) {
                return outputFormat.format(date);
            }
        } catch (ParseException e) {
            return null; // 如果解析失败则返回 null
        }
        return null; // 如果解析失败则返回 nullÏ
    }

    public String getApplyTime() {
        if(TextUtils.isEmpty(applyTime)) return null;
        applyTime = formatDate(applyTime);

        return applyTime;
    }

    public void setApplyTime(String applyTime) {
        this.applyTime = applyTime;
    }
}